/**
 * dailyAdmin vuex
 */
import posts from '@/plugins/request'
// initial state
const state = {
  operationList: {
    data: [
      {
        time: "time",
        person: "person",
        status: "status",
        questionTopic: "questionTopic",
        questionDesc: "questionDesc",
      }
    ],
    total: 0,
  },
}
// getters
const getters = {
  getOperationList: state => state.operationList,
}
// actions
const actions = {
  async getOperationList({ commit }, param) {
    let data = await posts.getOperationList(param)
    return data
  }, 
  async addOperationRecord({ commit }, param) {
    let data = await posts.addOperationRecord(param)
    return data
  }, 
  async solveOperationRecord({ commit }, param) {
    let data = await posts.solveOperationRecord(param)
    return data
  }, 
  async updateOperationRecord({ commit }, param) {
    let data = await posts.updateOperationRecord(param)
    return data
  }, 
}

// mutations
const mutations = {
  changeOperationList(state, data) {
    state.operationList.data = data.rows
    state.operationList.total = data.total
  },
}
export default {
  state,
  getters,
  actions,
  mutations
}